package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpInventoryPrintBinTagsPageUtil extends SeleniumPageUtil {
	public final static By IPBT_SPAN_HEADER = By.id("ctl44_lblHdr");
	public final static By IPBT_SPAN_WAREHOUSE = By.xpath("//*[@id='ctl44_PnlGeneral']/table/tbody/tr[1]/td[1]");
	public final static By IPBT_SPAN_PRINT_SERVER = By.xpath("//*[@id='ctl44_PnlGeneral']/table/tbody/tr[1]/td[2]");
	public final static By IPBT_SPAN_PRINTER = By.xpath("//*[@id='ctl44_PnlGeneral']/table/tbody/tr[1]/td[3]");
	public final static By IPBT_SELECT_WAREHOUSES = By.id("ctl44_cboWarehouses");
	public final static By IPBT_SELECT_PRINT_SERVERS = By.id("ctl44_cboPrintServers");
	public final static By IPBT_SELECT_PRINTERS = By.id("ctl44_cboPrinters");
	public final static By IPBT_TD_BIN = By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table[2]/tbody/tr[1]/td[1]");
	public final static By IPBT_SELECT_BINS = By.id("ctl44_cboBins");
	public final static By IPBT_INPUT_PREVIEW = By.id("ctl44_btnPreview");
	public final static By IPBT_INPUT_PRINT = By.id("ctl44_btnPrint");
	
	public static void enterInventoryPrintBinTagsPage() {
		SpHomePageUtil.enter();
		SpHomePageUtil.enterInventoryPrintBinTagsPage();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				IPBT_SELECT_WAREHOUSES, IPBT_SELECT_PRINT_SERVERS, IPBT_SELECT_PRINTERS, IPBT_SELECT_BINS, IPBT_INPUT_PREVIEW, IPBT_INPUT_PRINT
			});
		
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPBT_SELECT_WAREHOUSES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPBT_SELECT_PRINT_SERVERS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPBT_SELECT_PRINTERS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPBT_SELECT_BINS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPBT_INPUT_PREVIEW));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPBT_INPUT_PRINT));
	}
}
